Buffer Alloc Unsafe
A ponyfill for Buffer.allocUnsafe
.
Works as Node.js: v7.0.0
Works on Node.js: v0.10.0
Installation
npm install --save buffer-alloc-unsafe
Usage
const allocUnsafe = require('buffer-alloc-unsafe')
console.log(allocUnsafe(10))
console.log(allocUnsafe(10))
console.log(allocUnsafe(10))
allocUnsafe(-10)
API
allocUnsafe(size)
size
<Integer> The desired length of the new Buffer
Allocates a new non-zero-filled Buffer
of size
bytes. The size
must be
less than or equal to the value of buffer.kMaxLength
and greater than or equal
to zero. Otherwise, a RangeError
is thrown.
See also